module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};

/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {

/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;

/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};

/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;

/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}


/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;

/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;

/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "/dist/";

/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ({

/***/ 0:
/***/ (function(module, exports, __webpack_require__) {

	module.exports = __webpack_require__(399);


/***/ }),

/***/ 399:
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	exports.__esModule = true;

	var _tableColumn = __webpack_require__(400);

	var _tableColumn2 = _interopRequireDefault(_tableColumn);

	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

	/* istanbul ignore next */
	_tableColumn2.default.install = function (Vue) {
	  Vue.component(_tableColumn2.default.name, _tableColumn2.default);
	};

	exports.default = _tableColumn2.default;

/***/ }),

/***/ 400:
/***/ (function(module, exports, __webpack_require__) {

	'use strict';

	exports.__esModule = true;

	var _util = __webpack_require__(401);

	var _util2 = _interopRequireDefault(_util);

	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

	var methods = {
	  floderIcon: function floderIcon(context, row) {
	    var expanded = false;
	    if (row.$extra) {
	      expanded = row.$extra.expanded;
	    }
	    var floder = context.props.folderIcon;
	    var floder_open = context.props.folderIcon + '-open';
	    return expanded ? floder_open : floder;
	  },
	  hasChild: function hasChild(context, row) {
	    if (row[context.props.childNumKey] !== undefined) {
	      return row[context.props.childNumKey] > 0;
	    } else if (row[context.props.childKey] !== undefined) {
	      return row[context.props.childKey].length > 0;
	    } else {
	      return false;
	    }
	  },
	  paddingLeft: function paddingLeft(context, row) {
	    return parseInt(row[context.props.levelKey], 10) * 14 + 'px';
	  },
	  icon: function icon(row) {
	    if (row.$extra && row.$extra.loading === true) return 'el-icon-loading';
	    return row.$extra && row.$extra.expanded ? 'el-icon-caret-bottom' : 'el-icon-caret-right';
	  },
	  has: function has(context, item, list) {
	    var key = context.props.treeKey;
	    var parentKey = context.props.parentKey;
	    var uniqueKey = item[key];
	    var has = false;
	    list.forEach(function (row) {
	      if (row[key] === uniqueKey || row[key] === item[parentKey]) {
	        has = true;
	      }
	    });
	    return has;
	  },
	  commit: function commit(context, instance, list) {
	    var owner = instance.store.table; // methods.owner(context.parent);
	    var states = instance.store.states;

	    var selection = states.selection;
	    owner.store.commit('setData', list);

	    owner.clearSelection();
	    var data = owner.store.states._data;
	    data.forEach(function (row) {
	      if (methods.has(context, row, selection)) {
	        owner.toggleRowSelection(row);
	      }
	    });
	    // states.selection = currentSelecttion;
	    // if(selection != undefined){
	    //     states.selection = selection;
	    // }
	  },
	  setSystemExpanded: function setSystemExpanded(list, isRender) {
	    list.forEach(function (item) {
	      item.$extra = { isRender: isRender };
	    });
	  },
	  doexpanded: function doexpanded(instance, context, index, row) {
	    var isRender = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;

	    var owner = instance.store.table; // methods.owner(context.parent);
	    var vm = context.props;
	    var data = JSON.parse(JSON.stringify(owner.store.states._data));
	    if (data[index].$extra !== undefined && data[index].$extra.loading) return;
	    if (data[index].$extra === undefined) {
	      data[index].$extra = { expanded: true };
	    } else {
	      data[index].$extra.expanded = !data[index].$extra.expanded;
	    }
	    if (data[index].$extra.expanded) {
	      if (vm.remote != null) {
	        var hash = _util2.default.hash();
	        data[index].$extra.expanded = false;
	        data[index].$extra.hash = hash;
	        data[index].$extra.loading = true;
	        methods.commit(context, instance, data);
	        vm.remote(row, function (result) {
	          var list = owner.store.states._data;
	          if (row.$pid) {
	            list.forEach(function (o) {
	              if (o.id === row.$pid) {
	                o.children.forEach(function (i) {
	                  if (i.id === row.id) {
	                    i.children = result;
	                  }
	                });
	              }
	            });
	          }
	          var _index = _util2.default.index(hash, list);
	          list[_index].$extra = {
	            loading: false,
	            expanded: !!(result && result.length > 0)
	          };
	          result.forEach(function (o) {
	            o.$pid = row.id;
	          });
	          list[_index].children = result;
	          if (result && result.length > 0) {
	            var prefix = list.slice(0, _index + 1);
	            var i = 0;
	            while (i < _index + 1) {
	              list.shift();
	              i++;
	            }
	            methods.setSystemExpanded(result, isRender);
	            list = prefix.concat(result).concat(list);
	          } else {
	            list[_index][vm.childNumKey] = 0;
	          }
	          methods.commit(context, instance, list);
	        });
	      } else {
	        var prefix = data.slice(0, index + 1);
	        var i = 0;
	        while (i < index + 1) {
	          data.shift();
	          i++;
	        }
	        var result = row[vm.childKey];
	        methods.setSystemExpanded(row[vm.childKey], isRender);
	        data = prefix.concat(result).concat(data);
	        // owner.store.commit('setData', data);
	        methods.commit(context, instance, data);
	      }
	    } else {
	      var id = row[vm.treeKey];
	      var _result = [];
	      var removeIds = _util2.default.descendantsIds(id, data, vm.parentKey, vm.treeKey);
	      data.forEach(function (item) {
	        if (_util2.default.indexOf(item[vm.treeKey], removeIds) === -1) {
	          _result.push(item);
	        }
	      });
	      data = _result;
	      methods.commit(context, instance, data);
	      // owner.store.commit('setData', data);
	    }
	  },
	  evalDetails: function evalDetails(context, scope, h) {
	    var detail = void 0;
	    if (context.data.scopedSlots) {
	      detail = context.data.scopedSlots.default(scope);
	    } else {
	      var text = context.props.formatter ? context.props.formatter(scope.row, scope.column) : scope.row[context.props.prop];
	      detail = h('span', {}, text);
	    }
	    return detail;
	  }
	};
	exports.default = {
	  functional: true,
	  name: 'ue-el-table-tree-column',
	  props: {
	    label: String,
	    className: String,
	    labelClassName: String,
	    property: String,
	    prop: String,
	    width: {},
	    minWidth: {},
	    renderHeader: Function,
	    sortable: {
	      type: [String, Boolean],
	      default: false
	    },
	    sortMethod: Function,
	    resizable: {
	      type: Boolean,
	      default: true
	    },
	    context: {},
	    columnKey: String,
	    align: String,
	    headerAlign: String,
	    showTooltipWhenOverflow: Boolean,
	    showOverflowTooltip: Boolean,
	    fixed: [Boolean, String],
	    formatter: Function,
	    selectable: Function,
	    reserveSelection: Boolean,
	    filterMethod: Function,
	    filteredValue: Array,
	    filters: Array,
	    filterMultiple: {
	      type: Boolean,
	      default: true
	    },
	    treeKey: {
	      type: String,
	      default: 'id'
	    },
	    childNumKey: {
	      type: String,
	      default: 'child_num'
	    },
	    parentKey: {
	      type: String,
	      default: 'parent_id'
	    },
	    levelKey: {
	      type: String,
	      default: 'depth'
	    },
	    childKey: {
	      type: String,
	      default: 'children'
	    },
	    fileIcon: {
	      type: String,
	      default: 'el-icon-file'
	    },
	    folderIcon: {
	      type: String,
	      default: 'el-icon-folder'
	    },
	    remote: {
	      type: Function,
	      default: null
	    },
	    expandAll: {
	      type: Boolean,
	      default: false
	    },
	    expandKey: {
	      type: String,
	      default: 'expanded'
	    }
	  },
	  render: function render(createElement, context) {
	    var h = createElement;
	    var floder = function floder(scope) {
	      var row = scope.store.table.store.states._data[scope.$index];
	      if (row && row[context.props.expandKey] && (row.$extra === undefined || row.$extra.expanded === undefined)) {
	        methods.doexpanded(scope, context, scope.$index, scope.row, false);
	      } else if (row && (row.$extra === undefined || row.$extra.isRender)) {
	        if (context.props.expandAll) {
	          methods.doexpanded(scope, context, scope.$index, scope.row, true);
	        }
	      }

	      return h('span', {
	        on: {
	          click: function click($event) {
	            $event.preventDefault();
	            methods.doexpanded(scope, context, scope.$index, scope.row);
	          }
	        }
	      }, [h('span', { style: { paddingLeft: methods.paddingLeft(context, scope.row) } }, [h('i', { class: methods.icon(scope.row) }), scope._self._v(' '), h('i', {
	        class: methods.floderIcon(context, scope.row),
	        staticStyle: { 'padding-right': '7px' }
	      })]), methods.evalDetails(context, scope, h)]);
	    };
	    var leaf = function leaf(scope) {
	      return h('span', [h('span', {
	        style: { paddingLeft: methods.paddingLeft(context, scope.row) }
	      }, [h('i', {
	        class: scope.row.icon || context.props.fileIcon,
	        staticStyle: { 'padding-right': '7px', 'padding-left': '18px' }
	      })]), methods.evalDetails(context, scope, h)]);
	    };
	    return h('el-table-column', {
	      attrs: {
	        'prop': context.props.prop,
	        'label': context.props.label,
	        'width': context.props.width,
	        'class-name': context.props.className,
	        'label-class-name': context.props.labelClassName,
	        'property': context.props.property,
	        'min-width': context.props.minWidth,
	        'render-header': context.props.renderHeader,
	        'sortable': context.props.sortable,
	        'sort-method': context.props.sortMethod,
	        'resizable': context.props.resizable,
	        'context': context.props.context,
	        'column-key': context.props.columnKey,
	        'align': context.props.align,
	        'header-align': context.props.headerAlign,
	        'show-tooltip-when-overflow': context.props.showTooltipWhenOverflow,
	        'show-overflow-tooltip': context.props.showOverflowTooltip,
	        'fixed': context.props.fixed,
	        'formatter': context.props.formatter,
	        'selectable': context.props.selectable,
	        'reserve-selection': context.props.reserveSelection,
	        'filter-method': context.props.filterMethod,
	        'filtered-value': context.props.filteredValue,
	        'filters': context.props.filters,
	        'filter-multiple': context.props.filterMultiple
	      },
	      scopedSlots: {
	        default: function _default(scope) {
	          return methods.hasChild(context, scope.row) ? [floder(scope)] : [leaf(scope)];
	        }
	      }
	    });
	  }
	};

/***/ }),

/***/ 401:
/***/ (function(module, exports) {

	"use strict";

	exports.__esModule = true;
	var indexOf = function indexOf(val, arr) {
	  var has = -1;
	  for (var i = 0; i < arr.length; i++) {
	    if (arr[i] === val) {
	      has = i;
	      break;
	    }
	  }
	  return has;
	};

	var descendantsIds = function descendantsIds(id, data, parentKey, treeKey) {
	  var result = [];
	  var compare = [id];
	  var length = -1;
	  while (length !== compare.length) {
	    length = compare.length;
	    data.forEach(function (item) {
	      if (indexOf(item[parentKey], compare) > -1 && indexOf(item[treeKey], compare) === -1) {
	        result.push(item[treeKey]);
	        compare.push(item[treeKey]);
	      }
	    });
	  }
	  return result;
	};
	var hash = function hash() {
	  return Math.floor(Math.random() * Math.random() * Math.random() * Math.random() * 1000);
	};
	var index = function index(hash, data) {
	  var i = 0;
	  while (data[i]) {
	    if (data[i].$extra && data[i].$extra.hash === hash) {
	      break;
	    }
	    i++;
	  };
	  return i;
	};

	exports.default = {
	  indexOf: indexOf,
	  descendantsIds: descendantsIds,
	  hash: hash,
	  index: index
	};

/***/ })

/******/ });